home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 46
/
Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso
/
-in_the_mag-
/
reader_requests
/
scilab
/
bin
/
blatexpr
/
blatexpr_mn.html
next >
Wrap
Text File
|
1999-09-16
|
4KB
|
44 lines
#!/bin/csh
#-------------------------------------------------------------------
# Usage : Blatex [-orientation] xs ys filename.ps
# xs ys are the scaling factor
# orientation is p[ortrait] or l[andscape]
# filename.ps is a file from Scilab or Neoclo
#
# This script creates a tex file which include this ps file
# in a LaTeX style, the ps file is modified
#--------------------------------------------------------------------
if (<tex2html_verbatim_mark>#math12#?<I>SCI</I> = = 0)<I>thensetenvSCI</I>;SPMquot;/<I>store</I>3/<I>sci</I>/<I>scilab</I> - 2.2;SPMquot;<I>endifsetIMP</I> =SCI/imp/NperiPos.ps
switch (<tex2html_verbatim_mark>#math13##<I>argv</I>)<I>case</I>3 : <I>setorientation</I> = - <I>psetxs</I> =1
set ys=<tex2html_verbatim_mark>#math14#2<I>setorig</I> =3
breaksw
case 4:
set orientation=<tex2html_verbatim_mark>#math15#1<I>setxs</I> =2
set ys=<tex2html_verbatim_mark>#math16#3<I>setorig</I> =4
breaksw
default:
echo ;SPMquot;Usage : Blatexpr [-orientation] xscale yscale filename.ps;SPMquot;
echo ;SPMquot;example : Blatexpr 1.0 1.0 filename.ps ;SPMquot;
exit 1
endsw
<P>
switch (<tex2html_verbatim_mark>#math17#<I>orientation</I>)<I>case</I> - <I>l</I> : <I>case</I> - <I>p</I> : <I>breakswcase</I> - <I>landscape</I> : <I>setorientation</I> = - <I>lbreakswcase</I> - <I>portraitsetorientation</I> = - <I>pbreakswdefault</I> : <I>echo</I>;SPMquot;<I>Usage</I> : <I>Blatexpr</I> - <I>l</I>[<I>andscape</I>]<I>xscaleyscalefilename</I>.<I>ps</I>;SPMquot;<I>echo</I>;SPMquot;<I>Usage</I> : <I>Blatexpr</I> - <I>p</I>[<I>ortrait</I>]<I>xscaleyscalefilename</I>.<I>ps</I>;SPMquot;<I>exit</I>1<I>endsw</I><P><I>setbase</I> =orig:r
#set base=<tex2html_verbatim_mark>#math18#<I>base</I> : <I>rif</I> (orig == <tex2html_verbatim_mark>#math19#<I>base</I>.<I>epsf</I> )<I>thenmv</I>orig <tex2html_verbatim_mark>#math20#<I>base</I>.<I>pssetorig</I> =base.ps
endif
<P>
switch (<tex2html_verbatim_mark>#math21#<I>orientation</I>)<I>case</I> - <I>p</I> : <I>echo</I>;SPMquot;<tex2html_comment_mark>1<I>echo</I>;SPMquot;<tex2html_comment_mark>2<I>cat</I>IMP <tex2html_verbatim_mark>#math22#<I>orig</I>| <I>grep</I> - <I>v</I>;SPMquot;<tex2html_comment_mark>3<I>setwide</I> = `<I>echo</I>;SPMquot;300xs * p;SPMquot;|dc `
set high=`echo ;SPMquot; 212 <tex2html_verbatim_mark>#math23#<I>ys</I>*<I>p</I>;SPMquot;| <I>dc</I>`<I>breakswcase</I> - <I>l</I> : <I>echo</I>;SPMquot;<tex2html_comment_mark>4<I>echo</I>;SPMquot;<tex2html_comment_mark>5<I>cat</I>IMP <tex2html_verbatim_mark>#math24#<I>orig</I>| <I>grep</I> - <I>v</I>;SPMquot;<tex2html_comment_mark>6<I>sed</I> - <I>e</I>;SPMquot;<I>s</I>/<P><tex2html_verbatim_mark>#math25#</P><DIV ALIGN="CENTER">
0.510<I>div</I>000.510<I>divneg</I>0212010<I>div</I>
</DIV><P></P><I>concat</I>/90<I>rotate</I>10640<I>negtranslate</I>[0.510<I>div</I>000.510<I>divneg</I>031205<I>div</I>]<I>concat</I>/;SPMquot;base.epsf ;SPMgt; <tex2html_verbatim_mark>#math26#<I>base</I>.<I>epsf</I>.- <I>f</I>base.epsf
mv <tex2html_verbatim_mark>#math27#<I>base</I>.<I>epsf</I>.base.epsf
set wide=`echo ;SPMquot; 240 <tex2html_verbatim_mark>#math28#<I>xs</I>*<I>p</I>;SPMquot;| <I>dc</I>`<I>sethigh</I> = `<I>echo</I>;SPMquot;300ys * p;SPMquot;|dc `
breaksw
endsw
<P>
set widecm=`echo ;SPMquot;<tex2html_verbatim_mark>#math29#<I>wide</I>2.835/<I>p</I>;SPMquot;| <I>dc</I>`<I>sethighcm</I> = `<I>echo</I>;SPMquot;high 2.835 / p;SPMquot;|dc`
set hscale=`echo ;SPMquot;<tex2html_verbatim_mark>#math30#<I>xs</I>100*<I>p</I>;SPMquot;| <I>dc</I>`<I>setvscale</I> = `<I>echo</I>;SPMquot;ys 100 * p;SPMquot;|dc`
cat ;SPMlt;;SPMlt;END ;SPMgt;! <tex2html_verbatim_mark>#math31#<I>base</I>.<I>tex</I><tex2html_image_mark>#tex2html_wrap_inline94#<I>Figdir</I><tex2html_image_mark>#tex2html_wrap_inline95#<tex2html_image_mark>#tex2html_wrap_inline96#<tex2html_image_mark>#tex2html_wrap_inline97#<I>ENDrm</I> - <I>f</I>orig